public class Test {
    public static <T extends Comparable<T>>  T findMaxValue1(T[] arrays) {
        T max = arrays[0];
        for(int i = 1; i < arrays.length; i++) {
            if(max.compareTo(arrays[i])<0) {
                max = arrays[i];
            }
        }
        return max;
    }
}
//class Person<T extends Number>{
//
//}
//class Test1{
//    public static void main(String[] args) {
//        Person<Integer> person = new Person<>();
//        Person<String> person1 = new Person<String>();
//    }


class myArrays<T extends Comparable<T>> {
    public  T findMaxValue(T[] array) {
        T max = array[0];
        for(int i = 1; i < array.length; i++) {
            if(max.compareTo(array[i])<0) {
                max = array[i];
            }
        }
        return max;
    }
}
class MyArrays{
    public static <T extends Comparable<T>>  T findMaxValue(T[] array) {
        T max = array[0];
        for(int i = 1; i < array.length; i++) {
            if(max.compareTo(array[i])<0) {
                max = array[i];
            }
        }
        return max;
    }
}
    class Test1{
    public static void main(String[] args) {
        Integer[] arrays = {1,2,3,4,5,6,7,8,9,10};
        Integer ret = MyArrays.<Integer>findMaxValue(arrays);
        System.out.println(ret);
    }
    public static void main2(String[] args) {
        //静态
        Integer[] arrays = {1,2,3,4,5,6,7};
        Integer ret = Test.findMaxValue1(arrays);
        System.out.println(ret);
    }
    public static void main1(String[] args) {
        Integer[] arrays = {1,2,3,4,5,6,7};
        Test test = new Test();
        Integer ret = test.findMaxValue1(arrays);
        System.out.println(ret);
    }
}